//
//  LEWebImage.h
//  CreditAddressBook
//
//  Created by Lee on 15/8/24.
//  Copyright (c) 2015年 Lee. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef void(^LEWebImageDownloaderProgressBlock)(NSInteger receivedSize, NSInteger expectedSize);

typedef void(^LEWebImageCompletedWithFinishedBlock)(UIImage *image, NSError *error, BOOL finished);

//#define dispatch_main_sync_safe_le(block)\
//if ([NSThread isMainThread]) {\
//block();\
//}\
//else {\
//dispatch_sync(dispatch_get_main_queue(), block);\
//}

@interface LEWebImage : NSObject

+ (void)downloadWithURL:(NSString *)url progress:(LEWebImageDownloaderProgressBlock)progressBlock completed:(LEWebImageCompletedWithFinishedBlock)completedBlock;

@end
